﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.IO;
using HtmlAgilityPack;
using System.Net;


namespace LTHD_Web
{
    public partial class Loadnews : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string diachi = Request["link"];
            HttpWebRequest getDiaChi = (HttpWebRequest)WebRequest.Create(diachi);

            var phanhoi = getDiaChi.GetResponse().GetResponseStream();
            HtmlDocument htmlDoc = new HtmlDocument();
            htmlDoc.Load(phanhoi, Encoding.UTF8);

            HtmlNodeCollection nodes = htmlDoc.DocumentNode.SelectNodes("//div[@class='content']//div");
            string ketqua  = nodes[0].InnerHtml;

            lb_content.Text = ketqua.Replace("/Files", "http://vnexpress.net/Files");
            
        }
    }
}
